package t2.client.events;

import com.google.gwt.event.shared.GwtEvent;

public class LocalATcmdEvent extends GwtEvent<LocalATcmdEventHandler>{

    public static Type<LocalATcmdEventHandler> TYPE = new Type<LocalATcmdEventHandler>();
    private String command;
    private int param;
    private boolean response;


    public LocalATcmdEvent(String command){
        setCommand(command);
        setResponse(false);
    }
    
    public LocalATcmdEvent(String command, int param){
        setCommand(command);
        setParam(param);
    }


    /* Constructor used to pass objects over the bus. */
    public LocalATcmdEvent(String command, boolean response){
        setCommand(command);
        setResponse(response);
    }




    @Override
    public com.google.gwt.event.shared.GwtEvent.Type<LocalATcmdEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(LocalATcmdEventHandler handler) {
        handler.processATcmdEvent(this);
    }




    public String getCommand() {
        return command;
    }
    public void setCommand(String command) {
        this.command = command;
    }
    public boolean isResponse() {
        return response;
    }
    public void setResponse(boolean response) {
        this.response = response;
    }
    public int getParam() {
        return param;
    }
    public void setParam(int param) {
        this.param = param;
    }
}
